<?php

/**
 * @author Murat Cem YALIN <muratcem@gmail.com>
 * @copyright 2014 muratcem.com - walkerPHP.com
 * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3
 * @version 1.0.1
 */

namespace core\Config;

class Config implements IConfig{
    private static $initialized;
    private static $config;
    /**
     * loads the config file
     *
     * @return bool
     */
    public static function load()
    {
        if (static::$initialized !== TRUE){
            static::$config      = include_once __CONFIGFILE__;
            static::$initialized = TRUE;
        }

        return TRUE;
    }

    /**
     * get the value of config name
     *
     * @param string $ConfigName
     * @return string
     */
    public static function get($ConfigName = '')
    {
        if (static::$initialized !== TRUE){
            static::load();
        }

        return array_get(static::$config, $ConfigName);

    }

}